package com.activemanager.gearCenter;

import java.io.InputStream;

import com.example.android.navigationdrawerexample.R;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class G2Pressure extends Activity {
	

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.g2);
		
		initPic();
		
		Button back = (Button)findViewById(R.id.button1);
		back.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				finish();
			}
		});
		
	}

	private void initPic() {
		// TODO Auto-generated method stub
		BitmapFactory.Options opt = new BitmapFactory.Options();
		opt.inPreferredConfig = Bitmap.Config.RGB_565;
		opt.inPurgeable = true;
		opt.inInputShareable = true;


		RelativeLayout img = (RelativeLayout) findViewById(R.id.relativeLayout);
//		InputStream is = getResources().openRawResource(
//				R.drawable.background_normal);
//		Bitmap bit = BitmapFactory.decodeStream(is, null, opt);
//		img.setBackgroundDrawable(new BitmapDrawable(bit));
		img.setBackgroundResource(R.drawable.bg_540);

		ImageView img1 = (ImageView) findViewById(R.id.bg_text);
		InputStream is1 = getResources().openRawResource(
				R.drawable.u16_normal);
		Bitmap bit1 = BitmapFactory.decodeStream(is1, null, opt);
		img1.setBackgroundDrawable(new BitmapDrawable(bit1));
		
		img1 = (ImageView) findViewById(R.id.imageView1);
		 is1 = getResources().openRawResource(
				R.drawable.u12_normal);
		 bit1 = BitmapFactory.decodeStream(is1, null, opt);
		img1.setBackgroundDrawable(new BitmapDrawable(bit1));
		img1 = (ImageView) findViewById(R.id.imageView2);
		 is1 = getResources().openRawResource(
				R.drawable.u14_normal);
		 bit1 = BitmapFactory.decodeStream(is1, null, opt);
		img1.setBackgroundDrawable(new BitmapDrawable(bit1));
		
		
	}

}
